package tech

func (s *Solve) DoubleRectangle(g *Grid) (used bool, results []*Result) {
	for cand := range 9 {
		for _, row := range g.rows {
			if ok, rs := g.doubleRectCandHouse(cand, &row); ok {
				if OUTPUTRESULT {
					results = append(results, rs...)
				}
				used = true
				if !EXHAUSTIVE {
					return
				}
			}
		}
	}
	return
}

func (g *Grid) doubleRectCandHouse(cand int, line *House) (used bool, results []*Result) {
	chain := getStrongChainHouse(cand, line)
	if len(chain) == 0 {
		return
	}
	if chain[0].boxNum == chain[1].boxNum {
		return
	}

	return
}
